home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6075 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.0 KB

  1. Path: news1.h1.usa.pipeline.com!usenet
  2. From: grantp@usa.pipeline.com(Pete)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: How to delete array of pointers?
  5. Date: 11 Feb 1996 15:11:40 GMT
  6. Organization: Kalevi, Inc.
  7. Message-ID: <4fl0vc$55s@news1.usa.pipeline.com>
  8. NNTP-Posting-Host: pipe10.h1.usa.pipeline.com
  9. X-PipeUser: grantp
  10. X-PipeHub: usa.pipeline.com
  11. X-PipeGCOS: (Pete)
  12. X-Newsreader: Pipeline USA v3.3.0
  13.  
  14. On Feb 10, 1996 02:28:46 in article <How to delete array of pointers?>,
  15. 'ywleung@cs.cuhk.hk (Marty McFly)' wrote: 
  16.  
  17.  
  18. >If I write the following code in a function: 
  19. >    int** ptr; 
  20. >    ptr = new int*[1000]; 
  21. >Is this code means allocating 1000 integer pointers which is pointed by
  22. ptr? 
  23. >And then somehow I assign integer variable to ptr[0], ptr[1], ... and so
  24. on. 
  25. >So at the end of the function, how can I reclaim just those pointers?  The
  26. key 
  27. >point is that those integer variable assigned to the pointers should not
  28. be  
  29. >deleted. 
  30. delete [] ptr; 
  31.  
  32. -- 
  33. Pete Grant 
  34. Kalevi, Inc. 
  35. Object Oriented Software Development
  36.